/**
 * V零工api
 * Author: lzw_1006@163.com
 */

import axios from '@/libs/api.request'

export default class vOrderApi {
  // 获取派单列表
  static getDispatchList = (params) => {
    return axios.request({
      url: '/VOrder/GetVOrderList',
      data: params,
      method: 'post'
    })
  }
  // 获取派单详情
  static getDispatchDetail = (params) => {
    return axios.request({
      url: '/VOrder/GetVOrder',
      params: params,
      method: 'get'
    })
  }
  // 创建订单
  static createDispatch = (params) => {
    return axios.request({
      url: '/VOrder/PostOrder',
      data: params,
      method: 'post'
    })
  }
  // 删除订单
  static closeDispatch = (params) => {
    return axios.request({
      url: '/VOrder/CloseVOrder',
      data: params,
      method: 'post'
    })
  }
  // 根据企业id获取门店
  static getStore = (params) => {
    return axios.request({
      url: '/Customer/GetCustomerStore',
      params: params,
      method: 'get'
    })
  }
  // 获取对应订单的接单人员
  static getOrderWorker = (params) => {
    return axios.request({
      url: '/VOrder/GetVOrderDetails',
      params: params,
      method: 'get'
    })
  }
  // 获取所有的接单人员
  static getAllWorker = (params) => {
    return axios.request({
      url: '/Employee/GetEmployeeList',
      data: params,
      method: 'post'
    })
  }
  // 定向派单
  static dispatchVOrder = (params) => {
    return axios.request({
      url: '/VOrder/DispatchVOrder',
      data: params,
      method: 'post'
    })
  }

  /**
   * 支付模块
   */
  // 获取支付列表
  static getPayList = (params) => {
    return axios.request({
      url: '/VPay/VPayList',
      data: params,
      method: 'post'
    })
  }
  // 派单支付
  static vPayOrder = (params) => {
    return axios.request({
      url: '/VPay/VPayOrder',
      data: params,
      method: 'post'
    })
  }

  // 审核员工
  static auditVworker = (params) => {
    return axios.request({
      url: '/Employee/AuditEmployee',
      data: params,
      method: 'post'
    })
  }

  // 新建员工
  static createVworker = (params) => {
    return axios.request({
      url: '/Employee/PostEmployee',
      data: params,
      method: 'post'
    })
  }

  // 员工信息查看
  static GetEmployee = (params) => {
    return axios.request({
      url: '/Employee/GetEmployee',
      params: params,
      method: 'post'
    })
  }

  // 完成派单
  static wXCompleteVOrder = (params) => {
    return axios.request({
      url: '/VOrder/WXCompleteVOrder',
      data: params,
      method: 'post'
    })
  }

  // 订单完成列表
  static GetVOrderCompleteList = (params) => {
    return axios.request({
      url: '/VOrder/GetVOrderCompleteList',
      data: params,
      method: 'post'
    })
  }

  // 完成订单
  static VOrderComplete = (params) => {
    return axios.request({
      url: '/VOrder/VOrderComplete',
      params: params,
      method: 'post'
    })
  }
}
